#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
int a[maxn][maxn];
int main() {
	int n;
	cin >> n;
	
	int max = n * n;
	int x=1, y = n/2 + 1;
	a[x][y] = 1;
	for (int i=2; i<=max; i++) {
		int x1 = x-1;
		if (x1 < 1) {
			x1 = n;
		}
		int y1 = y+1;
		if (y1 > n) {
			y1 = 1;
		}
		if (a[x1][y1] == 0) {
			a[x1][y1] = i;
			x = x1;
			y = y1;
		} else {
			x1 = x+1;
			if (x1 > n) {
				x1 = 1;
			}
			y1 = y;
			a[x1][y1] = i;
			x = x1;
			y = y1;
		}
	}
	
	for (int i=1; i<=n; i++) {
		for (int j=1; j<=n; j++) {
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	return 0;
}
